/**
 * Created by 14229 on 2020/2/19.
 */
public class Test11 {
    public static void main(String[] args) {

        int[] arr = {1,3,5,7,9};
        int arrayMaxNo2 = getArrayMaxNo2(arr);
        System.out.println(arrayMaxNo2);
    }
    public static int getArrayMaxNo2(int[] arr){
        int max = 0;
        for (int i = 0; i <arr.length ; i++) {
            if (max<arr[i]){
                max = arr[i];
            }
        }
        int maxx = 0;
        for (int i = 0; i <arr.length ; i++) {
            if (arr[i]!=max){
                if (maxx<arr[i]){
                    maxx=arr[i];
                }
            }
        }
        return maxx;
    }
}
